package main

import (
	"i-search/service"
	"log"

	"github.com/gin-gonic/gin"
)

func main() {
	err := service.InitDB()
	if err != nil {
		log.Fatal(err)
	}
	r := gin.Default()
	r.GET("/ping", func(c *gin.Context) {
		list, err := service.SearchData()
		if err != nil {
			c.JSON(500, err)
		}
		c.JSON(200, list)
	})

	r.Run() // listen and serve on 0.0.0.0:8080
}
